import request from '@/utils/request'

// 查询流程模型列表
export function listModel(query) {
  return request({
    url: '/workflow/model/list',
    method: 'get',
    params: query
  })
}

// 查询流程模型详细
export function getModel(categoryId) {
  return request({
    url: '/workflow/model/' + categoryId,
    method: 'get'
  })
}

// 新增流程模型
export function addModel(data) {
  return request({
    url: '/workflow/model',
    method: 'post',
    data: data
  })
}

// 修改流程模型
export function updateModel(data) {
  return request({
    url: '/workflow/model',
    method: 'put',
    data: data
  })
}

// 删除流程模型
export function delModel(categoryId) {
  return request({
    url: '/workflow/model/' + categoryId,
    method: 'delete'
  })
}

// 获取流程模型流程图
export function getBpmnXml(modelId) {
  return request({
    url: '/workflow/model/bpmnXml/' + modelId,
    method: 'get'
  })
}

export function deployModel(params) {
  return request({
    url: '/workflow/model/deploy',
    method: 'post',
    params: params
  })
}

// 保存流程模型
export function saveModel(data) {
  return request({
    url: '/workflow/model/save',
    method: 'post',
    data: data
  })
}
